<script type="text/javascript" src="<?php echo base_url();?>asset/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>asset/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>asset/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type='text/javascript'>
$(function() {
$( "#tanggal_surat" ).datepicker({dateFormat : "yy-mm-dd",minDate : "-20",maxDate : "+10"});
});

</script>
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php
echo initialize_tinymce();
?>
<div id="main-content">
	<div class='title'>Form Edit Surat Keluar</div>
	
	<?php $row = $surat_keluar->row();
	echo form_open('con_surat_keluar/edit/'.$row->ID_SURAT_KELUAR);?>
	<table width='100%'> 
		<tr>
			<td>Nomor Surat</td>
			<td>:</td>
			<td>
			<?php echo form_input('no_surat',$row->NO_SURAT);?>
			<?php echo form_error('no_surat');?>
			</td>
		</tr>
		<tr>
			<td>Tanggal Surat Keluar</td>
			<td>:</td>
			<td>
			<input type="date" id="tanggal_surat" name="tanggal_surat" value="<?php echo $row->TANGGAL_SURAT; ?>"/>
			<?php 
			//$proptglsurat = array(
			//'type' =>'text',
			//'name' =>'tanggal_surat',
			//'id' => 'tanggal_surat',
			//);
			//echo form_input($proptglsurat,set_value('tanggal_surat'));
			//echo form_input('tanggal_surat',set_value('tanggal_surat'));?>
			<?php echo form_error('tanggal_surat');?>
			</td>
		</tr>
		<tr>
			<td>Hal</td>
			<td>:</td>
			<td>
			<?php echo form_input('hal',$row->HAL);?>
			<?php echo form_error('hal');?>
			</td>
		</tr>
		<tr>
			<td>Tujuan</td>
			<td>:</td>
			<td>
			<?php 
			echo form_input('tujuan',$row->TUJUAN);
			//menampilkan dropdown asal surat
			//foreach($kantor->result() as $row)
			//{
				//$array_kantor[$row->KD_KANTOR] = $row->NAMA_KANTOR;
			//}
			//echo form_dropdown('asal_surat',$array_kantor,set_value('asal_surat'));
			
			?>
			<?php echo form_error('tujuan');?>
			<?php //echo form_input('asal_surat',set_value('asal_surat'));?>
			<?php //echo form_error('asal_surat');?>
			</td>
		</tr>
		<tr>
			<td>Isi Surat</td>
			<td>:</td>
			<td>
			<?php echo form_textarea('isi_surat',$row->ISI_SURAT);?>
			<?php echo form_error('isi_surat');?>
			</td>
		</tr>
		<tr>
			<td>Tembusan</td>
			<td>:</td>
			<td>
			<?php echo form_input('tembusan',$row->TEMBUSAN);?>
			<?php echo form_error('tembusan');?>
			</td>
		</tr>
		<tr>
			<td>Penanda Tangan</td>
			<td>:</td>
			<td>
			<?php
			foreach($ttd->result() as $ttds)
			{
				$array_ttd[$ttds->ID_TTD] = $ttds->NAMA.' - '.$ttds->JABATAN;
			}
			echo form_dropdown('ttd',$array_ttd,$row->ID_TTD);
			?>
			<?php echo form_error('ttd');?>
			</td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td>
			<?php echo form_submit('submit','Update');?>
			</td>
		</tr>
	</table>
	<?php echo form_close();?>
</div>